package com.yykj.hospital.server.converter;


import com.yykj.hospital.client.dto.HospitalOfficerDTO;
import com.yykj.hospital.server.model.entity.HospitalOfficer;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class HospitalOfficerDTOConverter {
    public static HospitalOfficerDTO convert(HospitalOfficer hospitalOfficer){
        HospitalOfficerDTO dto = new HospitalOfficerDTO();
        BeanUtils.copyProperties(hospitalOfficer,dto);
        return dto;
    }
    public static List<HospitalOfficerDTO> convert(List<HospitalOfficer> list){
        return list.stream().map(HospitalOfficerDTOConverter::convert).collect(Collectors.toList());
    }
}
